import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  // {
  //   title: '报关头编号',
  //   align: "center",
  //   dataIndex: 'customsHeaderId'
  // },
  {
    title: '合同号',
    align: "center",
    dataIndex: 'contractNo'
  },
  {
    title: '出口国家',
    align: "center",
    dataIndex: 'exportCompany'
  },
  {
    title: '件号',
    align: "center",
    dataIndex: 'partNo'
  },
  {
    title: '零件名称',
    align: "center",
    dataIndex: 'partName'
  },
  {
    title: '数量',
    align: "center",
    dataIndex: 'qty'
  },
  {
    title: '总金额(元)',
    align: "center",
    dataIndex: 'totalPrice'
  },
  {
    title: '总重量(KG)',
    align: "center",
    dataIndex: 'totalWeight'
  },
  {
    title: '体积(M³)',
    align: "center",
    dataIndex: 'volume'
  },
  {
    title: 'HS编码',
    align: "center",
    dataIndex: 'hsCode'
  },
  {
    title: '税率(%)',
    align: "center",
    dataIndex: 'taxRate'
  },
  {
    title: '法定单位',
    align: "center",
    dataIndex: 'legalUnit'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "合同号",
    field: 'contractNo',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "出口国家",
    field: "exportCompany",
    component: 'Input', //TODO 范围查询
    colProps: { span: 6 },
  },
  {
    label: "件号",
    field: 'partNo',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "零件名称",
    field: "partName",
    component: 'Input', //TODO 范围查询
    colProps: { span: 6 },
  },
  {
    label: "HS编码",
    field: 'hsCode',
    component: 'Input',
    colProps: { span: 6 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  // {
  //   label: '报关头编号',
  //   field: 'customsHeaderId',
  //   component: 'Input',
  //   dynamicRules: ({ model, schema }) => {
  //     return [
  //       { required: true, message: '请输入报关头编号!' },
  //     ];
  //   },
  // },
  {
    label: '合同号',
    field: 'contractNo',
    component: 'Input',
  },
  {
    label: '出口国家',
    field: 'exportCompany',
    component: 'Input',
  },
  {
    label: '件号',
    field: 'partNo',
    component: 'Input',
  },
  {
    label: '零件名称',
    field: 'partName',
    component: 'Input',
  },
  {
    label: '数量',
    field: 'qty',
    component: 'InputNumber',
  },
  {
    label: '总金额(元)',
    field: 'totalPrice',
    component: 'InputNumber',
  },
  {
    label: '总重量(KG)',
    field: 'totalWeight',
    component: 'InputNumber',
  },
  {
    label: '体积(M³)',
    field: 'volume',
    component: 'InputNumber',
  },
  {
    label: 'HS编码',
    field: 'hsCode',
    component: 'Input',
  },
  {
    label: '税率(%)',
    field: 'taxRate',
    component: 'InputNumber',
  },
  {
    label: '法定单位',
    field: 'legalUnit',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
